package com.naicheng.ivote.doman;

import java.util.HashMap;

import com.naicheng.ivote.utils.TimeUtil;
public class BaseRequestBean {
	
	private String requestcommand;
	private String requestname;
	private String requestpassword;
	private String requesttime;
	
	/**
	 * 滚滚滚
	 */
	public BaseRequestBean() {
		super();
	}
	/**
	 * @param requestcommand
	 * @param requestname
	 * @param requestpassword
	 * @param requesttime
	 */
	public BaseRequestBean(String requestcommand, String requestname,
			String requestpassword, String requesttime) {
		super();
		this.requestcommand = requestcommand;
		this.requestname = requestname;
		this.requestpassword = requestpassword;
		this.requesttime = requesttime;
	}
	
	/**
	 * @param requestcommand
	 * @param requestname
	 * @param requestpassword
	 */
	public BaseRequestBean(String requestcommand, String requestname,
			String requestpassword) {
		super();
		this.requestcommand = requestcommand;
		this.requestname = requestname;
		this.requestpassword = requestpassword;
		this.requesttime = TimeUtil.getOrderDate(System.currentTimeMillis());
	}
	/**
	 * @param requestcommand
	 */
	public BaseRequestBean(String requestcommand) {
		super();
		this.requestcommand = requestcommand;
		this.requestname = "test";//UserManager.getName()
		this.requestpassword = "123321";//UserManager.getPwd();
		this.requesttime = TimeUtil.getOrderDate(System.currentTimeMillis());
	}

	public String getRequestcommand() {
		return requestcommand;
	}
	public void setRequestcommand(String requestcommand) {
		this.requestcommand = requestcommand;
	}
	public String getRequestname() {
		return requestname;
	}
	public void setRequestname(String requestname) {
		this.requestname = requestname;
	}
	public String getRequestpassword() {
		return requestpassword;
	}
	public void setRequestpassword(String requestpassword) {
		this.requestpassword = requestpassword;
	}
	public String getRequesttime() {
		return requesttime;
	}
	public void setRequesttime(String requesttime) {
		this.requesttime = requesttime;
	}
	
	
	/**
	 * 将对象封装进map
	 * 
	 * @param request
	 * @return
	 */
	public HashMap<String, String> toMap() {

		HashMap<String, String> map = new HashMap<String, String>();

		if (this.requestcommand != null) {
			map.put("requestcommand", this.requestcommand);
		} else {
			map.put("requestcommand", "");
		}

		if (this.requestname != null) {
			map.put("requestname", this.requestname);
		} else {
			map.put("requestname", "");
		}

		if (this.requestpassword != null) {
			map.put("requestpassword", this.requestpassword);
		} else {
			map.put("requestpassword", "");
		}

		if (this.requesttime != null) {
			map.put("requesttime", this.requesttime);
		} else {
			map.put("requesttime", "");
		}

		return map;

	}
	
	
	

}
